home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7275 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 69 6e 65 74 2e |Path: ne|ws.inet.|
|00000010| 66 69 21 75 73 65 6e 65 | 74 0a 46 72 6f 6d 3a 20 |fi!usene|t.From: |
|00000020| 6f 6d 61 40 69 6e 74 65 | 72 6e 65 74 2e 6f 73 6f |oma@inte|rnet.oso|
|00000030| 69 74 65 20 28 4f 6d 61 | 20 4e 69 6d 69 29 0a 4e |ite (Oma| Nimi).N|
|00000040| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000050| 6c 61 6e 67 2e 63 2b 2b | 0a 53 75 62 6a 65 63 74 |lang.c++|.Subject|
|00000060| 3a 20 4d 65 6d 6f 72 79 | 20 70 72 6f 62 6c 65 6d |: Memory| problem|
|00000070| 73 20 69 6e 20 57 69 6e | 20 33 2e 31 20 20 2d 20 |s in Win| 3.1 - |
|00000080| 20 61 61 2e 74 78 74 20 | 5b 31 2f 31 5d 20 20 2d | aa.txt |[1/1] -|
|00000090| 20 20 61 61 2e 74 78 74 | 20 5b 31 2f 31 5d 0a 44 | aa.txt| [1/1].D|
|000000a0| 61 74 65 3a 20 32 32 20 | 46 65 62 20 31 39 39 36 |ate: 22 |Feb 1996|
|000000b0| 20 31 34 3a 31 37 3a 33 | 39 20 47 4d 54 0a 4f 72 | 14:17:3|9 GMT.Or|
|000000c0| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 4f 6d 61 20 |ganizati|on: Oma |
|000000d0| 59 72 69 74 79 73 0a 4d | 65 73 73 61 67 65 2d 49 |Yritys.M|essage-I|
|000000e0| 44 3a 20 3c 34 67 68 74 | 75 33 24 6c 38 6d 40 6b |D: <4ght|u3$l8m@k|
|000000f0| 75 69 6b 6b 61 2e 69 6e | 65 74 2e 66 69 3e 0a 52 |uikka.in|et.fi>.R|
|00000100| 65 70 6c 79 2d 54 6f 3a | 20 61 73 6b 6f 2e 6a 75 |eply-To:| asko.ju|
|00000110| 76 6f 6e 65 6e 40 63 61 | 69 70 72 6f 69 6e 74 2e |vonen@ca|iproint.|
|00000120| 69 6e 65 74 2e 66 69 0a | 4e 4e 54 50 2d 50 6f 73 |inet.fi.|NNTP-Pos|
|00000130| 74 69 6e 67 2d 48 6f 73 | 74 3a 20 75 73 65 72 2d |ting-Hos|t: user-|
|00000140| 34 2d 39 33 2e 64 69 61 | 6c 2e 69 6e 65 74 2e 66 |4-93.dia|l.inet.f|
|00000150| 69 0a 4d 69 6d 65 2d 56 | 65 72 73 69 6f 6e 3a 20 |i.Mime-V|ersion: |
|00000160| 31 2e 30 0a 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |1.0.Cont|ent-Type|
|00000170| 3a 20 54 65 78 74 2f 50 | 6c 61 69 6e 0a 58 2d 4e |: Text/P|lain.X-N|
|00000180| 65 77 73 72 65 61 64 65 | 72 3a 20 57 69 6e 56 4e |ewsreade|r: WinVN|
|00000190| 20 30 2e 39 32 2e 36 2b | 0a 0a 49 20 68 61 76 65 | 0.92.6+|..I have|
|000001a0| 20 73 6f 6d 65 20 70 72 | 6f 67 72 61 6d 73 20 74 | some pr|ograms t|
|000001b0| 68 61 74 20 64 6f 20 61 | 20 6c 6f 74 20 6f 66 20 |hat do a| lot of |
|000001c0| 64 79 6e 61 6d 69 63 20 | 6d 65 6d 6f 72 79 20 61 |dynamic |memory a|
|000001d0| 6c 6c 6f 63 61 74 69 6f | 6e 20 77 69 74 68 0a 6d |llocatio|n with.m|
|000001e0| 61 6c 6c 6f 63 28 29 2e | 20 54 68 65 20 70 72 6f |alloc().| The pro|
|000001f0| 62 6c 65 6d 20 69 73 2c | 20 74 68 61 74 20 73 6f |blem is,| that so|
|00000200| 6d 65 74 69 6d 65 73 20 | 74 68 65 20 70 72 6f 67 |metimes |the prog|
|00000210| 72 61 6d 73 20 66 72 65 | 65 7a 65 20 77 68 65 6e |rams fre|eze when|
|00000220| 0a 74 72 79 69 6e 67 20 | 74 6f 20 66 72 65 65 20 |.trying |to free |
|00000230| 74 68 65 20 61 6c 6c 6f | 63 61 74 65 64 20 6d 65 |the allo|cated me|
|00000240| 6d 6f 72 79 20 77 69 74 | 68 20 66 72 65 65 28 29 |mory wit|h free()|
|00000250| 2e 20 57 68 65 6e 20 49 | 20 74 72 61 63 65 64 20 |. When I| traced |
|00000260| 74 68 65 0a 65 78 65 63 | 75 74 69 6f 6e 2c 20 49 |the.exec|ution, I|
|00000270| 20 66 6f 75 6e 64 20 74 | 68 61 74 20 74 68 65 20 | found t|hat the |
|00000280| 70 72 6f 67 72 61 6d 20 | 67 6f 65 73 20 69 6e 74 |program |goes int|
|00000290| 6f 20 74 68 65 20 66 72 | 65 65 28 29 20 66 75 6e |o the fr|ee() fun|
|000002a0| 63 74 69 6f 6e 2c 0a 62 | 75 74 20 6e 65 76 65 72 |ction,.b|ut never|
|000002b0| 20 72 65 74 75 72 6e 73 | 2e 20 41 6c 6c 20 70 6f | returns|. All po|
|000002c0| 69 6e 74 65 72 73 20 61 | 6e 64 20 73 75 63 68 20 |inters a|nd such |
|000002d0| 73 65 65 6d 20 74 6f 20 | 62 65 20 76 61 6c 69 64 |seem to |be valid|
|000002e0| 20 62 65 66 6f 72 65 0a | 74 68 65 20 63 72 61 73 | before.|the cras|
|000002f0| 68 2e 20 4f 6e 20 73 6f | 6d 65 20 6f 63 63 61 73 |h. On so|me occas|
|00000300| 69 6f 6e 2c 20 61 66 74 | 65 72 20 73 75 63 63 65 |ion, aft|er succe|
|00000310| 73 73 66 75 6c 6c 79 20 | 66 72 65 65 69 6e 67 20 |ssfully |freeing |
|00000320| 6d 65 6d 6f 72 79 2c 20 | 74 68 65 20 0a 70 72 6f |memory, |the .pro|
|00000330| 67 72 61 6d 20 68 61 73 | 20 68 61 6e 67 65 64 20 |gram has| hanged |
|00000340| 69 6e 73 69 64 65 20 66 | 6f 70 65 6e 28 29 20 61 |inside f|open() a|
|00000350| 6e 64 20 73 6f 6d 65 20 | 6f 74 68 65 72 20 6c 69 |nd some |other li|
|00000360| 62 72 61 72 79 20 66 75 | 6e 63 74 69 6f 6e 73 2e |brary fu|nctions.|
|00000370| 0a 0a 49 20 6b 6e 6f 77 | 20 74 68 61 74 20 74 68 |..I know| that th|
|00000380| 69 73 20 73 75 67 67 65 | 73 74 73 20 74 68 61 74 |is sugge|sts that|
|00000390| 20 74 68 65 20 61 6c 6c | 6f 63 61 74 65 64 20 6d | the all|ocated m|
|000003a0| 65 6d 6f 72 79 20 68 61 | 73 20 73 6f 6d 65 68 6f |emory ha|s someho|
|000003b0| 77 0a 62 65 63 6f 6d 65 | 20 63 6f 72 72 75 70 74 |w.become| corrupt|
|000003c0| 65 64 2c 20 62 75 74 20 | 61 73 20 66 61 72 20 61 |ed, but |as far a|
|000003d0| 73 20 49 20 63 61 6e 20 | 74 65 6c 6c 2c 20 74 68 |s I can |tell, th|
|000003e0| 69 73 20 69 73 20 6e 6f | 74 20 74 68 65 20 63 61 |is is no|t the ca|
|000003f0| 73 65 2e 0a 41 6c 6c 20 | 70 6f 69 6e 74 65 72 73 |se..All |pointers|
|00000400| 20 61 6e 64 20 64 61 74 | 61 20 73 65 65 6d 20 76 | and dat|a seem v|
|00000410| 61 6c 69 64 2e 20 49 20 | 68 61 76 65 20 75 73 65 |alid. I |have use|
|00000420| 64 20 74 68 65 20 65 78 | 61 63 74 20 73 61 6d 65 |d the ex|act same|
|00000430| 20 63 6f 64 65 0a 69 6e | 20 73 65 76 65 72 61 6c | code.in| several|
|00000440| 20 70 72 6f 67 72 61 6d | 73 2c 20 61 6e 64 20 6d | program|s, and m|
|00000450| 6f 73 74 20 6f 66 20 74 | 68 65 20 74 69 6d 65 20 |ost of t|he time |
|00000460| 69 74 20 77 6f 72 6b 73 | 20 70 65 72 66 65 63 74 |it works| perfect|
|00000470| 6c 79 2e 20 43 6f 75 6c | 64 0a 74 68 65 72 65 20 |ly. Coul|d.there |
|00000480| 62 65 20 73 6f 6d 65 20 | 70 65 63 75 6c 69 61 72 |be some |peculiar|
|00000490| 69 74 69 65 73 20 69 6e | 20 57 69 6e 64 6f 77 73 |ities in| Windows|
|000004a0| 27 20 6d 65 6d 6f 72 79 | 20 6d 61 6e 61 67 65 6d |' memory| managem|
|000004b0| 65 6e 74 20 74 68 61 74 | 20 63 61 75 73 65 0a 74 |ent that| cause.t|
|000004c0| 68 69 73 3f 0a 0a 54 68 | 65 20 63 6f 6d 70 69 6c |his?..Th|e compil|
|000004d0| 65 72 20 49 20 75 73 65 | 20 69 73 20 54 75 72 62 |er I use| is Turb|
|000004e0| 6f 20 43 2b 2b 20 34 2e | 35 2e 20 41 6c 6c 20 70 |o C++ 4.|5. All p|
|000004f0| 72 6f 67 72 61 6d 73 20 | 75 73 65 20 6c 61 72 67 |rograms |use larg|
|00000500| 65 20 6d 65 6d 6f 72 79 | 0a 6d 6f 64 65 6c 20 61 |e memory|.model a|
|00000510| 6e 64 20 61 6c 6c 20 6d | 65 6d 6f 72 79 20 61 6c |nd all m|emory al|
|00000520| 6c 6f 63 61 74 69 6f 6e | 20 69 73 20 64 6f 6e 65 |location| is done|
|00000530| 20 69 6e 20 66 61 72 20 | 68 65 61 70 2e 0a | in far |heap.. |
+--------+-------------------------+-------------------------+--------+--------+